package com.dc.commons.shiro.defaults;

import java.io.Serializable;
import java.util.List;

import org.apache.shiro.crypto.hash.SimpleHash;

import com.dc.commons.status.DataStatus;
import com.dc.commons.status.UseStatus;
import com.dc.commons.sys.persistence.User;

public class DefaultUser implements User,Serializable{

	private static final long serialVersionUID = 1L;
	
	private List<String> roles;
	private List<String> menus;
	public DefaultUser(){
	}
	public DefaultUser(String userName,String userCode){
		this.userName=userName;
		this.userCode=userCode;
		this.userPassword=new SimpleHash("MD5", userCode, new byte[]{}, 1).toHex();
		this.dataStatus=DataStatus.VALID;
		this.useStatus=UseStatus.ENABLED;

		
	}
	
	public List<String> getRoles() {
		return roles;
	}

	public void setRoles(List<String> roles) {
		this.roles = roles;
	}

	public List<String> getMenus() {
		return menus;
	}

	public void setMenus(List<String> menus) {
		this.menus = menus;
	}

	private String userName;
	private String userCode;
	private String userPassword;
	private DataStatus dataStatus;
	
	private UseStatus useStatus;
	@Override
	public String getUserName() {
		return this.userName;
	}

	@Override
	public void setUserName(String userName) {
		this.userName=userName;
		
	}

	@Override
	public String getUserCode() {
		return this.userCode;
	}

	@Override
	public void setUserCode(String userCode) {
		this.userCode=userCode;
	}

	@Override
	public DataStatus getDataStatus() {
		return this.dataStatus;
	}

	@Override
	public void setDataStatus(DataStatus dataStatus) {
		this.dataStatus=dataStatus;
	}

	@Override
	public String getUserPassword() {
		return this.userPassword;
	}

	@Override
	public void setUserPassword(String userPassword) {
		this.userPassword=userPassword;
	}
	
	public UseStatus getUseStatus() {
		return useStatus;
	}
	public void setUseStatus(UseStatus useStatus) {
		this.useStatus = useStatus;
	}
	
	

}
